package main

import (
	"context"
	"gitee.com/mesh_cpn/mesh.cpn.aphros/client"
	"time"
)

func main() {
	clt, err := client.NewConfigClient("123")
	if err != nil {
		println("no!!!")
	}
	ctx := context.Background()
	// 设置超时时间
	cxt, cancel := context.WithTimeout(ctx, 100*time.Second)
	defer cancel()

	println("start")

	client.Ceshi(clt, "3", "4")

	println("put to etcd completed")
	println("")

	res, err := clt.Get(cxt, "3")
	if err != nil {
		println("1：", err)
	}
	println("out1:", res)

	res, err = clt.Get(cxt, "3")
	if err != nil {
		println("2：", err)
	}
	println("out2:", res)

	res, err = clt.Get(cxt, "4")
	if err != nil {
		println("3：", err)
	}
	println("out3:", res)
	res, err = clt.Get(cxt, "3")
	if err != nil {
		println("4：", err)
	}
	println("out4:", res)

}
